import Config from "@/config/Config";

const RefreshTokenKey = 'APP_REFRESH_TOKEN'

const TokenKey: string = Config.loginTokenKey

export function getToken() {
    return sessionStorage.getItem(TokenKey)
}

export function getRefreshToken() {
    return sessionStorage.getItem(RefreshTokenKey)
}

export function setToken(token: string) {
    return sessionStorage.setItem(TokenKey, token)
}

export function setRefreshToken(token: string) {
    return sessionStorage.setItem(RefreshTokenKey, token)
}

export function removeToken() {
    sessionStorage.removeItem(RefreshTokenKey)
    return sessionStorage.removeItem(TokenKey)
}